﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace GameSPK.Model
{
    class CrossWord
    {
        public string chude { set; get; }
        public string dapan { set; get; }
        public int sohangngang { set; get; }
    }
    class HangNgangStart
    {
        public string CauHoi { set; get; }
        public string OHangNgang { set; get; }
        public int soKyTu { private set; get; }
        public string KeyChar { 
            set 
            {
                if (OHangNgang == null)
                {
                    return;
                }
                soKyTu = OHangNgang.Length;
                vitriKeyChar = new List<int>();
                char[] tukhoa = (value.ToUpper()).ToCharArray();
                char[] ochu = (OHangNgang.ToUpper()).ToCharArray();
                for (int i = 0; i < ochu.Count(); i++)
                {
                    for (int j = 0; j < tukhoa.Count(); j++)
                    {
                        if (tukhoa[j] == ochu[i])
                        {
                            vitriKeyChar.Add(i);
                            tukhoa[j] = '_';
                            break;
                        }
                    }
                }
                
            } 
             
        }
        public List<int> vitriKeyChar { get; private set; }
    }
    class CrossWordLayOut
    {
        public double Width { set; get; }
        public double Height { set; get; }
        public double Left { set; get; }
        public double Top { set; get; }
        public double FontSize { set; get; }
        public Brush ColorKey { get; private set; }
        public string sColorKey
        {
            set
            {
                ColorKey = new SolidColorBrush((Color)ColorConverter.ConvertFromString(value));
            }
        }

        public Brush ColorNotKey { get; private set; }
        public string sColorNotKey
        {
            set
            {
                ColorNotKey = new SolidColorBrush((Color)ColorConverter.ConvertFromString(value));
            }
        }

        public Brush BackgroundStart { get; private set; }
        public string sBackgroundStart
        {
            set
            {
                BackgroundStart = new SolidColorBrush((Color)ColorConverter.ConvertFromString(value));
            }
        }

        public Brush BackgroundSelected { get; private set; }
        public string sBackgroundSelected
        {
            set
            {
                BackgroundSelected = new SolidColorBrush((Color)ColorConverter.ConvertFromString(value));
            }
        }

        public Brush BackgroundOpen { get; private set; }
        public string sBackgroundOpen
        {
            set
            {
                BackgroundOpen = new SolidColorBrush((Color)ColorConverter.ConvertFromString(value));
            }
        }

        public Brush BackgroundClose { get; private set; }
        public string sBackgroundClose
        {
            set
            {
                BackgroundClose = new SolidColorBrush((Color)ColorConverter.ConvertFromString(value));
            }
        }
    }
}
